﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="ASP.NET.WebForm2" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script>
        var i =<%=i%>; //注：调用aspx.cs里的i字段
        var p =<%=pub()%>;//注：调用aspx.cs里的pub()方法
        alert(p+"　"+i);
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:Label ID="Label1" runat="server" Text=""><%=i %></asp:Label>
        <!--注：调用aspx.cs里的i字段-->
        <asp:Label ID="Label2" runat="server" Text=""><%=pub()%></asp:Label>
        <!--注：调用aspx.cs里的pub()方法-->
    </form>
</body>
</html>
